package com.stockz.ui.swing.charting.painter.shape;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;

import com.stockz.ui.swing.charting.model.Point;
import com.stockz.ui.swing.charting.util.SwingUtil;
import com.stockz.ui.swing.charting.view.StockChartPanel;
import com.stockz.ui.swing.charting.view.StockChartPanelState;


public class PointPainter {

	public static void paint(Graphics2D g, Point shape, Rectangle rectangle) {
		StockChartPanel panel = shape.getStockChartPanel();
		if(panel == null) return;
		StockChartPanelState state = panel.getStockChartPanelState();
		java.awt.Point point = SwingUtil.fitPoint(state, shape);
		g.setColor(Color.blue);
		g.fillRoundRect(point.x, point.y, 10, 10, 3, 3);
	}
	
}
